﻿using Model.DTO;
using Model.House;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace IDal
{
    public interface IHouseDal
    {
        /// <summary>
        /// 获取酒店类型表数据
        /// </summary>
        /// <returns></returns>
        IQueryable<HotelType> ShowHotelType();
        /// <summary>
        ///显示酒店信息+通过酒店类型查询+分页
        /// </summary>
        /// <param name="typeid">酒店类型</param>
        /// <param name="pageindex">当前页</param>
        /// <param name="pagesize">每页显示的条数</param>
        /// <returns>通过条件查询和分页显示的当前数据</returns>
        dynamic ShowHotel(int ?typeid = -1, int pageindex = 1, int pagesize = 3);
        /// <summary>
        /// 百度地图
        /// </summary>
        /// <param name="id">通过主键获取到整体数据</param>
        /// <returns>获取经度纬度</returns>
        Hotel FindHotel(int id);
        /// <summary>
        /// 通过选酒店的房间+显示+查询+分页
        /// </summary>
        /// <param name="hotelid">酒店id不可为空</param>
        /// <param name="min">面积最小值</param>
        /// <param name="max">面积最大值</param>
        /// <param name="typeid">房型id</param>
        /// <param name="pageindex">当前页</param>
        /// <param name="pagesize">每页显示的条数</param>
        /// <returns>通过条件查询和分页显示当前页面的数据</returns>
        dynamic ShowHouse(int hotelid, decimal? min, decimal? max, int? typeid = -1, int pageindex = 1, int pagesize = 3);
        /// <summary>
        /// 获取房型表信息
        /// </summary>
        /// <returns>获取房型表信息</returns>
        IQueryable<HouseType> ShowHouseType();
        /// <summary>
        /// 房间
        /// </summary>
        /// <param name="house">房间表</param>
        /// <returns>返回受影响行数</returns>
        int AddHouse(House house);
        /// <summary>
        /// 获取所有酒店信息
        /// </summary>
        /// <returns>获取所有酒店信息</returns>
        IQueryable<Hotel> ShowHotels();
        /// <summary>
        /// 通过酒店获取房间信息
        /// </summary>
        /// <param name="hotelid">酒店的id</param>
        /// <returns>通过酒店获取房间信息</returns>
        IQueryable<House> ShowHouseGetImg(int hotelid);
        /// <summary>
        /// 获取房间的具体信息
        /// </summary>
        /// <param name="houseid">房间if</param>
        /// <returns>通过主键返回房间的具体信息</returns>
        HouseDto Bindhouse(int houseid);
        /// <summary>
        /// 房间显示
        /// </summary>
        /// <param name="housename">房间名称进行模糊查询</param>
        /// <param name="min">价格最小值</param>
        /// <param name="max">价格最大值</param>
        /// <param name="pageindex">当前页</param>
        /// <param name="pagesize">每页现实的条数</param>
        /// <returns>通过条件查询个分页显示当前页面展示的数据</returns>
        dynamic ShowHouseDto(string? housename = "", decimal? min = null, decimal? max = null, int pageindex = 1, int pagesize = 3);

        /// <summary>
        /// 通过房间id做的反填
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        HouseShowDto GetHouseId(int id);
    }
}
